package com.itmake.webflux.security.property;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * security 属性
 *
 * @author Amjacks
 * @since 2023/08/10
 */
@Configuration
@ConfigurationProperties(prefix = "security")
public class SecurityProperty {

    /**
     * 开启认证
     */
    private Boolean enable = true;

    /**
     * jwt 密钥
     */
    private String secret = "";

    /**
     * 有效时长
     */
    private Long expireTime = 60L;

    /**
     * 刷新时间
     */
    private Long refreshTime = 20L;

    /**
     * 验证缓存
     */
    private Boolean verifyCache = true;

    /**
     * 白名单
     */
    private List<String> whites = new ArrayList<>();

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    public Long getRefreshTime() {
        return refreshTime;
    }

    public void setRefreshTime(Long refreshTime) {
        this.refreshTime = refreshTime;
    }

    public Boolean getVerifyCache() {
        return verifyCache;
    }

    public void setVerifyCache(Boolean verifyCache) {
        this.verifyCache = verifyCache;
    }

    public List<String> getWhites() {
        return whites;
    }

    public void setWhites(List<String> whites) {
        this.whites = whites;
    }
}
